import request from '@/utils/request'
import de from "element-ui/src/locale/lang/de";


//查询直播间列表
export function getRoomList(query) {
  return request({
    url: '/prod-api/wechat/broadcast/getRoomList',
    method: 'get',
    params: query
  })
}
//查询直播间权限
export function queryPermissions() {
  return request({
    url: '/prod-api/wechat/broadcast/queryPermissions',
    method: 'get'
  })
}

//创建直播间
export function creatRoom(data) {
  return request({
    url: '/prod-api/wechat/broadcast/creatRoom',
    method: 'post',
    data: data
  })
}

//编辑直播间
export function addSubjectInfo(data) {
  return request({
    url: '/prod-api/wechat/broadcast/updateRoom',
    method: 'post',
    data: data
  })
}

//直播间导入商品
export function addGoods(data) {
  return request({
    url: '/prod-api/wechat/broadcast/addGoods',
    method: 'post',
    data: data
  })
}

//删除直播间
export function deleteRoom(id) {
  return request({
    url: '/prod-api/wechat/broadcast/deleteRoom/'+id,
    method: 'post'
  })
}


//上下架商品
export function onsale(data) {
  return request({
    url: '/prod-api/wechat/broadcast/onsale',
    method: 'post',
    data:data
  })
}

//删除直播间商品
export function deleteRoomGood(data) {
  return request({
    url: '/prod-api/wechat/broadcast/deleteRoomGood',
    method: 'post',
    data:data
  })
}

//获取直播间分享码
export function getShare(id) {
  return request({
    url: '/prod-api/wechat/broadcast/getShare/'+id,
    method: 'post'
  })
}

//获取直播间下的商品
export function updateWaChatImg(id) {
  return request({
    url: '/prod-api/wechat/broadcast/WechatBroadcastMiddleController/getBroadcastMiddle/'+ id,
    method: 'get',
  })
}

//申请开通直播权限
export function applyFor() {
  return request({
    url: '/prod-api/wechat/broadcast/applyFor',
    method: 'post'
  })
}
